#ifndef __MODBUS_H__
#define __MODBUS_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <stdbool.h>

union num_t
{

	long int m_val;
	int i_val;
	float f_val;

};
int conver_endian_long(unsigned char *dst, const unsigned char *src, int len);
int create_socket(const char *ip, int port);
int modbus_func_01(int sockfd);
float modbus_func_03(int sockfd);
int modbus_func_04(int sockfd, float *data);
int modbus_func_16(int sockfd, float val);
#endif